package com.yuch;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

/**
 * 封装配置文件中定义的数据
 * 定义位Bean
 * 在使用的时候直接autowied注入就可以了
 */
@Data
@Component
@ConfigurationProperties(prefix = "datasource")
public class MyDataSource {

    private String driver;

    private String username;

    private String password;

    private String url;

}
